home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
docp_1_1.zip
/
DOCP.DOC
< prev
next >
Wrap
Text File
|
1992-04-29
|
10KB
|
223 lines
docp - directory-oriented file copy
Version 1.1, Copyright (c) 1992, Roy Bixler
General Idea:
Docp is a directory-oriented copy program. It gives you better
control over which files you can copy or move. In the simplest
case, all files are copied from the source directory to the target
directory. A list of files can be specified to limit what is
copied. This list can have wild-card file specifications (default
list = *.*) and may be applied against either the source or target
directory (default = source). If a file specification in the list
starts with a '-', it is excluded from the copy. File dates and
times can be used to limit the file list. Recursive copies are
also supported.
Usage:
docp [-abcdfghijlmnorstvwz?] source_dir target_dir [file_list]
Options:
Multiple criteria options ('-a', '-d', '-n', '-o', and '-w') are
AND'ed together. For example, specifying '-an' means copy the
source files which are newer and have the archive bit set. If
either condition is false, the copy will not be done. If you wish
to copy either the newer files or the files with the archive bit
set, just do two separate 'docp' commands (i.e. 'docp -a' followed
by 'docp -n').
The options are described below:
-a - Use archive bit
Copy only files which have the archive bit set. Once the copy
is complete, the archive bit for the source file will be
turned off.
-b - Batch mode.
Turn off all interactive prompts. Where questions are
normally asked, the following default actions are taken
instead. If the target directory does not exist, try to
create it. If a target file is read-only, delete the target
and re-try the copy. Also, if the target device fills up, the
program simply prints a message and aborts.
-c - Check
Check the operation of the 'docp' command without actually
copying any files. This mode sets the verbose options.
-d [boa]mm/dd/yy - Date
Copy files based on the date that they were last changed.
This flag takes one argument starting with the letters 'b',
'o', or 'a', followed by the date in the form, mm/dd/yy. The
prefix 'b' stands for 'before' but not including the specified
date. The prefix 'o' stands for 'on' the specified date, and
'a' stands for 'after' the specified date. The date ranges
specified using the 'a' and 'b' prefixes are 'and-ed'
together. The 'o' dates are then 'or-ed' with the result.
For example to specify all files last-changed during March,
you could type:
docp -vd ao3/1/91 -d b4/1/91 . a:
-f file_name - File
Get the file list from the file which is specified as an
argument following the '-f' flag. If the file_name is "-" then
the file list will come from standard input.
-g - Gather
Gather the files from the source directory and all its
subdirectories into the one target directory.
-h - Hidden
Copy hidden files as well as non-hidden files. Applies to
'-z - zap target' option below.
-i - Interactive
Interactively ask the user if he wishes to copy each file,
before the copy occurs. Also applies to '-z - zap target'
option below.
-j - Join files
This is the companion of the '-l' option (see below). If a
file with the same name as the source file exists in the
target directory, append the source file to the target file.
-l - Larger than target
Split up files that are larger than target. See the 'Disk
Overflow' section below for further explanation.
-m - Move
Removes all copied files from the source directory.
-n - Newer
Copy only newer files. If the source file already has a copy
in the target directory, then the copy or move only occurs if
the source file has a later date/time stamp then the target
copy. If a source file does not already exist in the target
directory, then the source file is copied. This option can be
handy for doing fast backups.
-o - Older
Copy only older files. If the source file already has a copy
in the target directory, then the copy or move only occurs if
the source file has an earlier date/time stamp then the target
copy. If a source file does not already exist in the target
directory, then the source file is copied. This option can be
handy for quickly restoring backups.
-no - Not On target
Copy only if the source file does not exist in the target
directory. This is a trick that uses the '-n' and '-o'
options.
-r - Recursive
Recursively copy all of the subdirectories of the source
directory. Subdirectories that don't already exist under the
target directory are created. Also, if the '-z - zap target'
option is specified, recursively deletes target subdirectories.
-s - Source
Apply the file list to the source directory. This is the
default. The alternative is '-t'.
-t - Target
Apply the file list to the target directory. For example,
typing 'docp -t . a:', would copy only those files in the
current directory which were already on the 'A' drive. This
is handy for doing backups.
-v - Verbose
Report all files that are copied or moved.
-vv - Very Verbose
Report all files that are copied or not copied.
-w [ba]hh:mm[pa] - When
Copy files based on the time that they were last changed.
This flag takes one argument starting with the letters 'b', or
'a', followed by the time in the form, hh:mm[ap]. The prefix
'b' stands for 'before' but not including the specified time.
and the prefix 'a' stands for 'after' the specified date. The
time ranges specified using the 'a' and 'b' prefixes are
'and-ed' together. For example to specify all files
last-changed after 10:00pm but before 11:00pm you could type:
docp -vt a10:00p -t b11:00p . a:
If this option is used without the date option, then the
current system date is assumed.
-z - Zap
Zap (i.e. clear all files) in the target directory
(or directories) before copying.
-?
Print full documentation and exit. You are here!
Disk Overflow:
If the destination drive is full during a copy, then 'docp' will
pause and allow the user to change diskettes. If the user
specified '-o', '-n', or '-t' then she will not be able to change
floppies. This is because the original floppy was used to
determine which files to copy. The '-l' option is useful here,
since the file that caused the target to be full will remain on
the current target and will continue to be copied on the new
target as a split file. Without '-l', this file will be erased on
the current target and the copy will be retried on the new target.
File List:
If not specified, the default file list is '*.*'. Any files
prefixed with '-' will be excluded from the file list. For
example, to copy all files in a directory except a file called
'junk' or those with a '.obj' suffix, you could type:
docp -v . a: *.* -junk -*.obj
or
docp -v . a: -junk -*.obj
To copy a file starting with '-', use a prefix of '\'. For
example, to copy a file named '-copy.me', you could type:
docp -v . a: \-copy.me
On a recursive copy, the file list is applied recursively to the
source or target (with '-t' option) directory and all
subdirectories.
Nonexistent Target Directory:
If the target directory does not exist, either the user will be
asked if she wishes to create it or, if the '-b' option is
specifi